import { sendSock, createWebSocket, closeSock } from "@/utils/socket";
const test = {
  namespaced: true,
  state: {
    socket:null
  },
  mutations: {
    SET_SOCKET: (state, value) => {
      state.value = value
    }
  },
  actions: {
    createWebSocket({commit}) {
      return new Promise((resolve,reject) =>{
        createWebSocket(create_callback)
    } )
    },
    sendSock({commit},msg) {
      return new Promise((resolve,reject) =>{
        sendSock(msg)
      } )
    },
  }
}
const create_callback=(msg)=>{
  console.log(msg,123)
}

export default test
